# coding:utf8
import time
import urllib.request
from SQDownload import SQDownload
from bs4 import BeautifulSoup
#简单（静态页面）爬虫1
if __name__ == '__main__':


    url = "http://www.11467.com/tianjin/search/3338-7.htm"
    header = {
       'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.26 Safari/537.36 Core/1.63.5702.400 QQBrowser/10.2.1893.400'
    }
    request = urllib.request.Request(url,headers=header)
    response1 = urllib.request.urlopen(request)
    suop = BeautifulSoup(response1,'html.parser',from_encoding='utf-8')
    strs = suop.find(class_='companylist').find_all('h4')
    response1.close()
    for str in strs:
        a = str.find('a')
        time.sleep(21)
        download = SQDownload();
        download.domnload(a['href'])


